package JAVA300.第十章IO;

import java.io.*;

/**
 * 熟悉IO步骤--标准化
 */

public class IO_Study02 {
    public static void main(String[] args) throws IOException {
        //创建源
        File file =new File("/Users/hqqs/Documents/CodeJava/JavaSE_Exp/src/JAVA300/第十章IO/IOTest01.txt");
        //选择流
        InputStream is = null;
        try {
            is = new FileInputStream(file);
            int temp ;
            while ((temp=is.read())!=-1) {
                System.out.println((char) temp);//hello world

            }
        }catch (FileNotFoundException e){
            e.printStackTrace();
        }finally {//避免如果进入catch就无法关闭了

            if (null != is){//只有用到is 再关闭
                //释放资源
                is.close();
            }

        }





    }
}
